"use client";

import Main from "@/src/components/Main";
import MainProvider from "@/src/providers/MainProvider";
import ProfileProvider from "@/src/providers/ProfileProvider";
import { useSearchParams } from "next/navigation";
import { Suspense } from "react";

export default function DetailPage() {
  return (
    <Suspense fallback={<div>Loading...</div>}>
      <DetailContent />
    </Suspense>
  );
}

function DetailContent() {
  // 获取URL参数
  const searchParams = useSearchParams();
  const productName = searchParams.get("productName") || "";

  return (
    <main>
      <MainProvider>
        <ProfileProvider>
          <Main showHomePage={false} deviceName={productName} />
        </ProfileProvider>
      </MainProvider>
    </main>
  );
}
